//
//  UMLogFilesManager.h
//  PetGuGu
//
//  Created by _G.R.M. on 2023/8/16.
//

#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

NS_ASSUME_NONNULL_BEGIN

#ifdef DEBUG
static const DDLogLevel ddLogLevel = DDLogLevelAll;
#elif __DAILYBUILD__N__DEBUG__
static const DDLogLevel ddLogLevel = DDLogLevelAll;
#else
static const DDLogLevel ddLogLevel = DDLogLevelInfo;
#endif
//DDLogLevel ddLogLevel = DDLogLevelInfo;

#define UMErrorLog(frmt, ...)   DDLogError((@"%s L%d " frmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define UMWarnLog(frmt, ...)    DDLogWarn((@"%s L%d " frmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#define UMMapLog(frmt, ...)     DDLogInfo((@"[Map]%s L%d " frmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define UMLog(frmt, ...)        DDLogInfo((@"%s L%d " frmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#define UMDebugLog(frmt, ...)   DDLogDebug((@"%s L%d " frmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)


#pragma mark - 日志管理
@interface UMGlobalLogFiles : NSObject

+ (void)setupLogFiles;

+ (void)zipLogsFile:(void (^)(BOOL success, NSString *path))complete;
+ (void)removeLogs;

// 查询接口，必要的话上传日志
+ (void)uploadLogsIfNeed;
// 强制上传日志到服务端 tag
+ (void)uploadLogsToTag:(NSString *)tag;


+ (NSString *)net_cfg_err_url_tag;

@end

#pragma mark - 目录管理
@interface UMGlobalLogFileDir : DDLogFileManagerDefault

@end


#pragma mark - 日志输出格式
@interface UMGlobalLogFileFormatter : DDLogFileFormatterDefault

@property (nonatomic, assign) BOOL osFormat;

@end


NS_ASSUME_NONNULL_END
